Skip to content

Fix phpMyAdmin and Adminer crash on PHP 8.5#3444

Merged
JanJakes merged 1 commit intotrunkfrom
fix/phpmyadmin-php85-pdo-sqlite
Mar 31, 2026
Merged

Fix phpMyAdmin and Adminer crash on PHP 8.5#3444
JanJakes merged 1 commit intotrunkfrom
fix/phpmyadmin-php85-pdo-sqlite

Conversation

@JanJakes
Copy link
Copy Markdown
Member

@JanJakes JanJakes commented Mar 30, 2026

Summary

  • phpMyAdmin and Adminer crashed on PHP 8.5 because they created a plain PDO instance and passed it to WP_SQLite_Connection. The SQLite plugin calls PDO::sqliteCreateFunction(), which is deprecated in PHP 8.5.
  • The plugin already checks for PDO\SQLite to use the new API, but the check failed because a plain PDO was passed.
  • Fixed by passing the database path to WP_SQLite_Connection instead of a pre-built PDO object. Its constructor already selects the correct PDO class.

Test plan

  • Run npm nx dev playground-website and open http://127.0.0.1:5400/website-server/
  • Change PHP to 8.5
  • Open phpMyAdmin — verify it loads without errors
  • Open Adminer — verify it loads without errors

Fixes #3443

phpMyAdmin and Adminer created a plain PDO instance and passed it to
WP_SQLite_Connection. On PHP 8.5, PDO::sqliteCreateFunction() is
deprecated in favor of Pdo\Sqlite::createFunction(). The SQLite
integration plugin already handles this by checking instanceof
PDO\SQLite, but the check failed because a plain PDO was passed.

Let WP_SQLite_Connection create the PDO instance itself by passing the
database path instead. Its constructor already selects the correct class
(PDO\SQLite on PHP >= 8.4, PDO otherwise).

Fixes #3443
@JanJakes JanJakes requested review from a team, ashfame and Copilot March 30, 2026 10:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes phpMyAdmin/Adminer crashes on PHP 8.5 by ensuring WP_SQLite_Connection receives a DB path (so it can choose the correct PDO SQLite implementation) instead of a pre-built plain PDO instance.

Changes:

  • Replace manual new PDO('sqlite:...') construction with WP_SQLite_Connection(['path' => ...]) in Adminer and phpMyAdmin integrations.
  • Remove PDO imports now that direct instantiation is no longer used.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/playground/website/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php Pass DB path into WP_SQLite_Connection to avoid deprecated API usage on PHP 8.5
packages/playground/tools/src/phpmyadmin/DbiMysqli.php Same change for phpMyAdmin DB driver initialization
packages/playground/personal-wp/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php Mirror the Adminer fix in the personal-wp package
Comments suppressed due to low confidence (1)

packages/playground/personal-wp/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php:1

  • As in the website variant, the explicit PDO::ATTR_ERRMODE = PDO::ERRMODE_EXCEPTION configuration was removed. If WP_SQLite_Connection doesn't set this, Adminer behavior may change. Consider enforcing exception mode through WP_SQLite_Connection defaults or constructor options so runtime errors remain visible and consistent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@ashfame ashfame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested as per instructions.
Note: Adminer was already functional (not throwing any errors) on trunk.

@JanJakes JanJakes merged commit ca56f6c into trunk Mar 31, 2026
47 checks passed
@JanJakes JanJakes deleted the fix/phpmyadmin-php85-pdo-sqlite branch March 31, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PhpMyAdmin doesn't work for site that uses PHP 8.5

3 participants